package com.lizhi.yun.core.patient;/**
 * @program: hbsf_yun
 * @name RszPatientHandler
 * @description: 患者信息
 * @author: lizhi
 * @create: 2021-11-03 14:02
 */

import com.lizhi.common.yun.entity.ListResponseResult;
import com.lizhi.mybatis.interceptor.PageBounds;
import com.lizhi.utils.json.SamJsonUtil;
import com.lizhi.yun.db.rsz.dao.RszPatientDao;
import com.lizhi.yun.db.rsz.entity.RszPatientEntity;
import com.lizhi.yun.deploy.NewBaseHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 *@program: hbsf_yun
 *@name RszPatientHandler
 *@description: 患者信息
 *@author: lizhi
 *@create: 2021-11-03 14:02
 */
@Slf4j
@Service
public class RszPatientHandler extends NewBaseHandler {

    @Resource
    private RszPatientDao rszPatientDao;

    /**
     *功能描述 根据患者姓名和患者证件号码查询
     * @author lizhi
     * @date 2021/11/3
     * @param json:
     * @return com.lizhi.common.yun.entity.ListResponseResult
     */
    public ListResponseResult doMain(String json){
        Map<String, Object> map = SamJsonUtil.toMap(json);
        PageBounds pageBounds = getPageBounds(map);
        List<RszPatientEntity> rszPatientEntities = rszPatientDao.selectByMap(map, pageBounds);
        return getListResult(pageBounds.getCountRows(), rszPatientEntities, map);
    }
}
